package com.slipper.collect.support;

import com.slipper.collect.IDataConvert;

import java.util.Date;

public class SecondToDateDataConvert implements IDataConvert {
    @Override
    public Object convert(String param, Object data) {
        return switch (data) {
            case Integer second -> new Date(second * 1000);
            case Long second -> new Date(second * 1000);
            case java.math.BigDecimal second -> new Date(second.longValue() * 1000);
            case null, default -> null;
        };

    }
}
